package cn.tedu.web.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 【我的钱包 - 账目表】
 * </p>
 *
 * @author issen
 * @since 2021-10-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("ec_wallet_account")
@ApiModel(value="WalletAccount对象", description="【我的钱包 - 账目表】")
public class WalletAccount implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "发生交易的用户，参考 user 表的主键")
    private Integer uid;

    @ApiModelProperty(value = "交易金额")
    private BigDecimal amount;

    @ApiModelProperty(value = "交易描述")
    private String description;

    // 数据库中tinyint(1) 对应 Java的Boolean类型
    // 否则对应位Integer
    @ApiModelProperty(value = "交易的类型 0：支出 1：收入")
    private Integer type;

    @ApiModelProperty(value = "交易时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime time;


}